package com.yeskery.nut.web.demo.controller;

import com.yeskery.nut.annotation.api.Api;
import com.yeskery.nut.annotation.api.ApiGroup;
import com.yeskery.nut.annotation.bean.Autowired;
import com.yeskery.nut.annotation.web.GetMapping;
import com.yeskery.nut.annotation.web.RequestMapping;
import com.yeskery.nut.annotation.web.RestController;
import com.yeskery.nut.web.demo.biz.ProductBiz;
import com.yeskery.nut.web.demo.common.R;
import com.yeskery.nut.web.demo.domain.Product;

import java.util.List;

/**
 * 商品controller
 * @author Yeskery
 * 2023/7/28
 */
@ApiGroup("商品")
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductBiz productBiz;

    /**
     * 获取商品列表
     * @return
     */
    @Api(value = "获取商品列表", responseClass = Product.class)
    @GetMapping("/list")
    public R<List<Product>> getProductList() {
        return R.ok(productBiz.getProductList());
    }
}
